<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="javabean.*"%>
<%@page import="javabean.user.*"%>
<!DOCTYPE html>
<html lang="zh-cn">
	<%
		User user = (User)request.getAttribute("user");
		String uid = user.getUid();
		String uname = ParseDouble.parseNullToStr(user.getUname());
		String sex = ParseDouble.parseNullToStr(user.getSex());
		String grade = ParseDouble.parseNullToStr(user.getGrade());
		String major = ParseDouble.parseNullToStr(user.getMajor());
		String banbie = ParseDouble.parseNullToStr(user.getBanbie());
		String tel  = ParseDouble.parseNullToStr(user.getTel());
		String shorttel = ParseDouble.parseNullToStr(user.getShorttel());
		String email = ParseDouble.parseNullToStr(user.getEmail());
		String dormitory = ParseDouble.parseNullToStr(user.getDormitory());
		String introduce = ParseDouble.parseNullToStr(user.getIntroduce());
		String birthday = ParseDouble.parseNullToStr(user.getBirthday());
		String pic = ParseDouble.parseNullToStr(user.getPic());
		long credit = user.getCredit();
		long activity = user.getActivity();
		long contribution = user.getContribution();
		long favorability = user.getFavorability();
	%>
    <head>
    	<title>修改个人资料</title>
    	<meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="/bookcrossing/css/bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="/bookcrossing/css/main.css">
        <link rel="stylesheet" type="text/css" href="/bookcrossing/css/user.css">
        <link rel="shortcut icon" type="image/png" href="/bookcrossing/img/favicon.png" />
	</head>
	<body>
		<jsp:include page="../public/head.jsp"></jsp:include>
		<div class="modal fade" id="dialog-box">
	    	<div class="modal-dialog">
	    		<div class="modal-content">
	    			<div class="modal-body">
	    				<span class="tips-pic"></span> 
	    				<span class="tips-content"></span>
	    			</div>
	    			<div class="modal-footer">
	    				<button type="button" class="btn btn-info btn-sm ok-btn" data-dismiss="modal">好滴</button>
	    			</div>
	    		</div>
	    	</div>
	    </div>
		<div class="container user-info-container">
			<div class="content-top">
				<a href="javascript:history.go(-1);" class="go-back"><< 返回上一页</a>
			</div>
			<div class="content-main">
				<div class="u-i-content tab-content">
					<div class="tab-pane fade in active" id="basic-info">
						<form id="u-i-form" class="form-horizontal u-i-form" name="u-i-form" action="UserInfoEdit">
							<input type="hidden" name="uid" class="uid" value="<%=uid %>"/>
							<div class="pic-wrap">
								<div class="pic-show">
									<img src="/bookcrossing/img/user/<%=pic %>" alt="头像" class="pre-img"/>
									<p>支持jpg,png,gif (小于1.5M)</p>
								</div>
								<div class="pic-input-wrap">
									<button type="button" class="btn btn-info btn-sm upload-btn"/>
										<span class="glyphicon glyphicon-upload"></span> 上传头像
									</button>
									<input type="file" name="pic" class="pic" id="pic" accept="image/jpeg,image/gif,image/png" multiple/>
								</div>
							</div>
							<div class="form-group">
							    <label for="uname" class="col-sm-2 control-label"><span class="countdown">* </span>姓名</label>
							    <div class="col-sm-5">
							      <input type="text" class="form-control uname" id="uname" name="uname" value="<%=uname %>" placeholder="不会无名吧~" >
							    </div>
							</div>
							<div class="form-group">
							    <label for="sex" class="col-sm-2 control-label"><span class="countdown">* </span>性别</label>
							    <div class="col-sm-5 sex-wrap">
							    <%
							    	String manSelected = "",womSelected="";
							    	if("女".equals(sex)){
							    		womSelected = "checked";
							    	}else{
							    		manSelected = "checked";
							    	}
							    %>
							      <input type="radio" name="sex" class="sex" value="男" <%=manSelected %>/> 男&nbsp;&nbsp;&nbsp;&nbsp;
							      <input type="radio" name="sex" class="sex" value="女" <%=womSelected %>/> 女
							    </div>
							</div>
							<div class="form-group">
							    <label for="grade" class="col-sm-2 control-label">年级</label>
							    <div class="col-sm-5">
							      <input type="text" class="form-control grade" id="grade" name="grade" value="<%=grade %>" placeholder="年级" >
							    </div>
							</div>
							<div class="form-group">
							    <label for="major" class="col-sm-2 control-label">专业</label>
							    <div class="col-sm-5">
							      <input type="text" class="form-control major" id="major" name="major" value="<%=major %>" placeholder="专业" >
							    </div>
							</div>
							<div class="form-group">
							    <label for="banbie" class="col-sm-2 control-label">班别</label>
							    <div class="col-sm-5">
							      <input type="text" class="form-control banbie" id="banbie" value="<%=banbie %>" name="banbie" placeholder="哪个班滴" >
							    </div>
							</div>
							<div class="form-group">
							    <label for="tel" class="col-sm-2 control-label"><span class="countdown">* </span>手机</label>
							    <div class="col-sm-5">
							      <input type="text" class="form-control tel" id="tel" name="tel" value="<%=tel %>" placeholder="手机长号">
							    </div>
								<label for="shorttel" class="col-sm-1 control-label">短号</label>
							    <div class="col-sm-3">
							      <input type="text" class="form-control shorttel" id="shorttel" name="shorttel" value="<%=shorttel %>" placeholder="短号">
							    </div>	    
							</div>
							<div class="form-group">
							    <label for="email" class="col-sm-2 control-label"><span class="countdown">* </span>邮箱</label>
							    <div class="col-sm-9">
							      <input type="text" class="form-control email" id="email" name="email" value="<%=email %>" placeholder="邮件">
							    </div>
							</div>
							<div class="form-group">
							    <label for="dormitory" class="col-sm-2 control-label">宿舍</label>
							    <div class="col-sm-9">
							      <input type="text" class="form-control dormitory" id="dormitory" value="<%=dormitory %>" name="dormitory">
							    </div>
							</div>
							<div class="form-group">
							    <label for="birthday" class="col-sm-2 control-label" >生日</label>
							    <div class="col-sm-9">
							      <input type="text" class="form-control birthday" id="birthday" value="<%=birthday %>" name="birthday" onfocus="javascript:HS_setDate(this)">
							    </div>
							</div>
							<div class="form-group">
							    <label for="introduce" class="col-sm-2 control-label">个人简介</label>
							    <div class="col-sm-9">
							      <textarea class="form-control introduce" id="introduce" name="introduce" rows="4" placeholder="写点啥吧，让大家认识你^_^"><%=introduce %></textarea>
							    </div>
							</div>
							<button type="submit" class="btn btn-primary basic-info-submit" name="basic-info-submit" id="basic-info-submit">完成</button>
							<input type="hidden" name="oldpicurl" class="old-pic-url" value="<%=pic%>"/>
						</form>
					</div>
					<div id="c-p-wrap" class="tab-pane fade">
						<form id="change-psw-form" class="form-horizontal change-psw-form" action="changePassword">
							<div class="form-group">
							    <label for="oldpsw" class="col-sm-4 control-label"><span class="countdown">* </span>旧密码</label>
							    <div class="col-sm-5">
							      <input type="password" class="form-control oldpsw" id="oldpsw" name="oldpsw" placeholder="旧的密码" >
							    </div>
							</div>
							<div class="form-group">
							    <label for="psw" class="col-sm-4 control-label"><span class="countdown">* </span>新密码</label>
							    <div class="col-sm-5">
							      <input type="password" class="form-control psw" id="psw" name="psw" placeholder="新的密码" >
							    </div>
							</div>
							<div class="form-group">
							    <label for="confirmpsw" class="col-sm-4 control-label"><span class="countdown">* </span>确认密码</label>
							    <div class="col-sm-5">
							      <input type="password" class="form-control confirmpsw" id="confirmpsw" name="confirmpsw" placeholder="确认密码" >
							    </div>
							</div>
							<button type="submit" class="btn btn-primary chang-psw-btn" id="change-psw-btn">确定</button>
						</form>
					</div>
				</div>
				
				<div class="right">
		      		<div >
			       		<div class="right-top"></div>
			       		<div class="right-content-wrap">
			        		<div class="right-content">
			        			<p class="right-c-title">修改个人资料</p>
			        			<ul id="u-i-tab" class="nav">
			        				<li class="active">
			        					<a href="#basic-info" data-toggle="tab">修改基本信息</a>
			        				</li>
			        				<li >
			        					<a href="#c-p-wrap" data-toggle="tab">修改密码</a>
			        				</li>
			        			</ul>
			        			
			        		</div>
			        	</div>
			      		<div class="right-bottom"></div>
		      		</div>
	      		</div>
			</div>
		</div>
		<jsp:include page="../public/foot.jsp"></jsp:include>
		<script src="/bookcrossing/js/jquery-1.9.1.min.js" type="text/javascript"></script>
        <script src="/bookcrossing/js/bootstrap.min.js" type="text/javascript" ></script>
        <script src="/bookcrossing/js/common.js" type="text/javascript" ></script>
        <script src="/bookcrossing/js/select_date.js" type="text/javascript" ></script>
        <script src="/bookcrossing/js/md5.min.js" type="text/javascript" ></script>
        <script src="/bookcrossing/js/user-info-edit.js" type="text/javascript" ></script>
	</body>